package com.huangdebiao.oa.controller;

import com.huangdebiao.oa.dto.UserRoleDto;
import com.huangdebiao.oa.service.UserService;
import com.huangdebiao.oa.service.impl.UserServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import javax.sql.rowset.spi.SyncResolver;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@WebServlet(name = "HDB_UserController",urlPatterns = "/HDBUser")
public class HDB_UserController extends HDB_BaseController {

    private UserService userService = new UserServiceImpl();

    @Override
    public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {

        String method = req.getParameter("method");
        if (method.equals("login")){


            String phone = req.getParameter("phone");
            String password = req.getParameter("password");


        }else if (method.equals("checkPhoneNumber")){


            String phoneNumber = req.getParameter("phoneNumber");



        }else if (method.equals("addRoleById")){



        }else if (method.equals("findAllRolesOfAllUser")){

            List<UserRoleDto> allRolesOfAllUserList = userService.findAllRolesOfAllUser();
            HashMap<String, Object> map = new HashMap<>();


        }

    }
}
